﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="STT.Profile.Default" %>
<%@ Reference Page="~/Default.aspx" %>
<%@ Register Src="~/Profile/UserControlsGV/UcCongViec.ascx" TagPrefix="uc1" TagName="UcCongViec" %>


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Đào Tạo Ngắn Hạn</title>

    <link rel="shortcut icon" href="http://owwwlab.com/favicon.ico"/>
    <link href="css/font-awesome.min.css" rel="stylesheet" />
    <link href="css/bootstrap.css" rel="stylesheet" />
    <%--<link href="css/perfect-scrollbar-0.4.5.min.css" rel="stylesheet" />--%>
    <link href="css/magnific-popup.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet" />
    <link href="css/styles/style.css" rel="stylesheet" />
    <link href="css/font-awesome.min.css" rel="stylesheet" />
    

    <script src="js/jquery-1.10.2.js"></script>
    <script src="js/TweenMax.min.js"></script>
    
    <%--<script src="js/perfect-scrollbar-0.4.5.with-mousewheel.min.js"></script>--%>
    <%--<script src="js/custom.js"></script>--%>

    <script src="js/jquery.js"></script>
    <script src="js/stickytooltip.js"></script>
    <link href="css/stickytooltip.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet" />
    <script src="../js/maruti.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <%-- <script src="../js/swfobject.js"></script>--%>
    <style>
        #-search {
            float: left;
            position: relative;
            width: 450px;
            /*margin-left:50px;*/
        }

            #-search input[type="text"] {
                color: #555555;
                font: 12px Arial,Helvetica,Sans-serif;
                height: 30px;
                margin-top: 10px;
                padding: 0 25px 0 10px;
                width: 400px;
                z-index: 1;
            }

            #-search .onlyie6 {
                background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
                border: 0 none;
                position: absolute;
                right: 30px;
                top: 17px;
                z-index: 2;
            }
    </style>

</head>
<body>
    <form id="Form1" runat="server">
        <div style="width: 100%; overflow: auto; background-color: white" align="center">
            <div id="head-nav" class="navbar navbar-default navbar-fixed-top">
                <div class="container-fluid">
                    <div class="navbar-collapse collapse" style="height: 1px;">
                        <ul class="nav navbar-nav">
                            <li><a href="../Default.aspx">Trang chủ</a></li>
                            <li>
                                <div id="-search">
                                    <asp:TextBox ID="txttimkiem" runat="server" CssClass="form-control" placeholder=""></asp:TextBox>
                                    <asp:ImageButton ID="ImgbtTk" CssClass="onlyie6" OnClick="ImgbtTk_Click" runat="server" ImageUrl="~/Profile/img/search.png" />
                                         <script type="text/javascript">
                                             $("#txttimkiem").keydown(function (e) {
                                                 if (e.keyCode == 13)
                                                 $("#ImgbtTk").click();
                                                    });
                                        </script>
                                    </div>
                            </li>
                        </ul>
                        <ul class="nav navbar-nav navbar-right user-nav">
                            <li class="dropdown profile_menu">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <asp:Label ID="lbltenhv" runat="server" Text=""></asp:Label>
                                    <b class="caret"></b>
                                </a>
                                <ul class="dropdown-menu">
                                    <li><a href="Default.aspx?mod=DMK1303" id="dmk" runat="server">Đổi mật khẩu</a></li>
                                    <li><a href="Default.aspx?mod=TTCN117" id="ttcn" runat="server">Thông tin cá nhân</a>
                                    </li>
                                  <%--  <li><a href="#">Tin nhắn</a></li>--%>
                                    <li class="divider"></li>
                                    <li><%--<a href="#">Sign Out</a>--%>
                                        <asp:LinkButton ID="lbnthoat" runat="server" OnClick="lbtthoat_Click">Thoát</asp:LinkButton>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                        <ul class="nav navbar-nav navbar-right not-nav">
                            <li class="button dropdown">
                                <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" id="sotn"><i class=" fa fa-comments">
                                </i>  <span class="bubble">
                                        <asp:Label ID="lbltinnhan" runat="server" Text=""></asp:Label>
                                    </span></a>
                                <ul class="dropdown-menu messages">
                                    <li>
                                        <div class="nano nscroller has-scrollbar">
                                            <div class="content" tabindex="0" style="right:0">
                                                <ul>
                                                    <asp:DataList ID="ddltinnhan" runat="server" Width="100%" CellPadding="0" CellSpacing="0">
                                                    <ItemTemplate>
                                                    <li>
                                                        <a href="#"> 
                                                             <span class="date pull-right"><%# DataBinder.Eval(Container.DataItem,"ThoiGianGui","{0:MM/dd/yyyy}") %></span> 
                                                             <span class="name"><%# Eval("IdGui") %></span> 
                                                            <asp:Label ID="Label1" runat="server" Text='<%# HttpUtility.HtmlDecode((string)Eval("NoiDung")) %>' Width="200px" ToolTip='<%# HttpUtility.HtmlDecode((string)Eval("NoiDung")) %>' CssClass="texttitle"></asp:Label>
                                                        </a>
                                                        <hr style="width:100%;margin:0px;"/>
                                                    </li>
                                                    </ItemTemplate>
                                                    </asp:DataList>
                                                </ul>
                                            </div>
                                            <div class="pane" style="display: none;">
                                                <div class="slider" style="height: 20px; top: 0px;"></div>
                                            </div>
                                        </div>
                                        <ul class="foot">
                                            <li><a href="" id="xemtn" runat="server">Xem tất cả tin nhắn </a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                            <li class="button dropdown">
                                <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" id="so-tb">
                                    <i class="fa fa-globe"></i>
                                    <span class="bubble">
                                        <asp:Label ID="lblsothongbao" runat="server" Text=""></asp:Label>
                                    </span>
                                </a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <div class="nano nscroller has-scrollbar">
                                            <div class="content" tabindex="0" style="right: -15px;">
                                                <ul>
                                                    <asp:DataList ID="ddlthongbao" runat="server">
                                                        <ItemTemplate>
                                                            <li>
                                                                <a href='<%# "Default.aspx?mod=CTTBHV1303&key=" + Eval("MaTT") %>' title='<%# Eval("TieuDe")%>'
                                                                    class="texttitle" style="width: 33%"><%# Eval("TieuDe")%><span class="date">
                                                                        <%# Eval("NgayDang")%>
                                                                  </span></a>
                                                            </li>
                                                        </ItemTemplate>
                                                    </asp:DataList>
                                                </ul>
                                            </div>
                                            <div class="pane" style="display: none;">
                                                <div class="slider" style="height: 20px; top: 0px;"></div>
                                            </div>
                                        </div>
                                        <ul class="foot">
                                            <li><a href="Default.aspx?mod=DSTBHV1707">Xem tất cả thông báo </a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                        </ul>

                    </div>
                </div>
            </div>
            <div id="wrapper">
                <a href="#sidebar" class="mobilemenu"><i class="icon-reorder"></i></a>
                <div id="sidebar">
                    <asp:PlaceHolder ID="pl_menu" runat="server"></asp:PlaceHolder>
                </div>
                <div id="main">
                    <div style="top: 50px; width: 80%">
                        <asp:PlaceHolder ID="plindex" runat="server"></asp:PlaceHolder>

                    </div>
                    <div id="chat">
                        <%-- <div class="widget-box widget-the-news">
                    <div class="panel-right2">
                        <div class="panel-content nopadding">
                            <ul class="the-news">
                            </ul>
                        </div>
                    </div>
                </div>--%>
                        <asp:PlaceHolder ID="pl_CongViec" runat="server"></asp:PlaceHolder>
                        <div class="widget-box  widget-box-right">
                            <div class="chat-users panel-right2">
                                <div class="panel-content nopadding">
                                    <ul class="contact-list" id="contact-list">
                                        
                                        <asp:ListView ID="lvDanhSachChat" runat="server" 
                                            OnItemDataBound="lvDanhSachChat_ItemDataBound">
                                            <ItemTemplate>
                                                
                                                <li id="<%# Eval("TenDN").ToString().TrimEnd() %>">
                                                    <a href="#" data-original-title="<%# "Tài khoản:  "+ Eval("TenDN").ToString().TrimEnd() %>"
                                                        class="tip-bottom">
                                                        <img class="img-user" alt="img" src="<%# DisplayImage(Eval("TenDN").ToString().TrimEnd(),Eval("Anh").ToString().Trim()) %>" />
                                                        <span class="name-user"><%# Eval("TenNguoiDung").ToString().TrimEnd() %></span>
                                                    </a>
                                                </li>
                                            </ItemTemplate>
                                        </asp:ListView>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <script>
        TenDN = "<%= Session["TenFDN"]%>";
        RoleDN = "<%= Session["roleFhvgv"]%>";
        MaGV="<%= Session["MaFgv"]%>";
        MaHV = "<%= Session["MaFhv"]%>";
        TenNguoiDung = "<%=  Session["FTenNguoiDung"]%>";
        Anh = "<%= Session["FAnh"].ToString().TrimEnd() == "" ?"avatar-default.jpg":Session["Anh"] %>";
    </script>
    <script src="../Scripts/jquery.signalR-2.0.3.min.js"></script>
    <script src="/signalr/hubs" type="text/javascript"></script>
    <script src="../js/chat.js"></script>

    <script>
        $('#so-tb').click(function () {
            if (MaHV != "" && MaGV=="") {
                $.ajax({
                    type: "POST",
                    url: "Default.aspx/UpdateTBHV",
                    data: '{MaHV: "' + MaHV + '",Rolehvgv: "' + RoleDN + '"}',
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (response) {
                        //OnSuccess(response, Ma, Ten)
                        //alert(response);
                        document.getElementById("lblsothongbao").textContent = "0";
                    },
                    failure: function (response) {
                        alert('Không kết nối được!');
                    },
                    error: function (response) {

                        //alert(MaHV + ' '+ RoleDN);
                    }
                });
            }
            else if (MaGV != "" && MaHV == "") {
                $.ajax({
                    type: "POST",
                    url: "Default.aspx/UpdateTBHV",
                    data: '{MaHV: "' + MaGV + '",Rolehvgv: "' + RoleDN + '"}',
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (response) {
                        //OnSuccess(response, Ma, Ten)
                        //alert(response);
                        document.getElementById("lblsothongbao").textContent = "0";
                    },
                    failure: function (response) {
                        alert('Không kết nối được!');
                    },
                    error: function (response) {
                       //alert(MaGV + ' ' + RoleDN);
                        //alert('Có lỗi xảy ra!');
                    }
                });
            }
        })
        $('#sotn').click(function()
        {
            if (MaHV != "" && MaGV == "")
            {
                $.ajax({
                    type: "POST",
                    url: "Default.aspx/UpdateTNHVGV",
                    data: '{MaHVGV :"' + MaHV + '",Rolehvgv: "' + RoleDN + '"}',
                    contentType: "application/json;charset=utf-8",
                    dataType: "json",
                    success: function (response)
                    {
                        document.getElementById("lbltinnhan").textContent="0";
                    },
                    failure: function (response) {
                        aler('Không kết nối được!');
                    },
                    error: function (response) {
                        //alert("Lỗi");
                        //alert(MaHV + ' ' + RoleDN)
                    }
                });
            }
            else if (MaGV != "" && MaHV == "") {
                $.ajax({
                    type: "POST",
                    url: "Default.aspx/UpdateTNHVGV",
                    data: '{MaHVGV: "' + MaGV + '",Rolehvgv: "' + RoleDN + '"}',
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (response) {
                        //OnSuccess(response, Ma, Ten)
                        //alert(response);
                        document.getElementById("lbltinnhan").textContent = "0";
                    },
                    failure: function (response) {
                        alert('Không kết nối được!');
                    },
                    error: function (response) {
                        //alert(MaGV + ' ' + RoleDN);
                        //alert('Có lỗi xảy ra!');
                    }
                });
            }
        });
    </script>
</body>
</html>
